#!/usr/bin/python
# Import the CGI module
import cgi
import xmlrpcclient
import cgitb; cgitb.enable()
import urllib

if __name__ == "__main__":
    #---------------------------------------------------------------------------
    #
    #--------------------------------------------------------------------------
    print "Content-Type: text/html\n\n"
    print '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'
    #-----------------------------------------------------------------------------
    #printspiner()
    #----------------------------------------------------------------------------
    print '<html xmlns="http://www.w3.org/1999/xhtml"><head>'
    print ''
    print ''
    print '<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><title>feedreader</title>'
    print ''
    print '<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">'
    print '<link href="http://localhost/shellcode.css" rel="stylesheet" type="text/css">'
    #---------------------------------------------------------------------------------
    print "<FORM METHOD = post ACTION = \"feeds-main.py\">\n"
    #----------------------------------------------------------------------------------
    print ''
    print ''
    print '<div id="body">'
    print '<table border="0" cellpadding="0" cellspacing="0" width="100%">'
    print '  <tbody><tr>'
    print '    <td width="5%">&nbsp;</td>'
    print '  </tr>'
    print '  <tr>'
    print '    <td height="1"></td>'
    print '    <td colspan="3" bgcolor="#ff0000"></td>'
    print '    <td></td>'
    print '  </tr>'
    print '  <tr>'
    print '    <td>&nbsp;</td>'
    print '    <td rowspan="3" align="right" bgcolor="#204444" height="100%" valign="top">'
    print '	          	<table border="0" cellpadding="0" cellspacing="3" width="100%">'
    print '      <tbody>'
    print ''
    print '	  <tr>'
    print '        <td>'
    print '		<div class="izquierda" align="right">'
    print '		 <a href="news-main.py" class="botonizquierda">MAIN</a> </div>'
    print '		</td>'
    print '      </tr>'
    print ''
    print '	  <tr>'
    print '        <td>'
    print '		<div class="izquierda" align="right">'
    print '		 <a href="feeds-main.py" class="botonizquierda">FEEDS</a> </div>'
    print '		</td>'
    print '      </tr>'
    print ''
    print '	  	  <tr>'
    print '        <td>'
    print '		<div class="izquierda" align="right">'
    print '		 <a href="search-main.py" class="botonizquierda">SEARCH</a> </div>'
    print '		</td>'
    print '      </tr>'
    print '	  <tr>'
    print '        <td bgcolor="#ff1111" height="1"></td>'
    print '      </tr>'
    print '	  </tbody></table>'
    print ''
    print ''
    print '	  </td>'
    print '    <td>&nbsp;</td>'
    print '    <td>&nbsp;</td>'
    print '  </tr>'
    print '  '
    print '  <tr>'
    print '    <td height="1"></td>'
    print '    <td></td>'
    print '    <td bgcolor="#330000"></td>'
    print '    <td></td>'
    print '  </tr>'
    print '  <tr>'
    print '    <td>&nbsp;</td>'
    print '    <td colspan="2">&nbsp;</td>'
    print '    <td>&nbsp;</td>'
    print '  </tr>'
    print '  <tr>'
    print '    <td>&nbsp;</td>'
    print '    <td>&nbsp;</td>'
    print '    <td>&nbsp;</td>'
    print '    <td>&nbsp;</td>'
    print '  </tr>'
    print '  <tr>'
    print '    <td>&nbsp;</td>'
    print '    <td colspan="3" align="right" valign="top">	  <table border="0" cellpadding="0" cellspacing="0" width="100%">'
    print '      <tbody><tr>'
    print '        <td id="content" width="20">&nbsp;</td>'
    print '        <td id="content" valign="top"><br>          '
    print ''
    print '<div class="datalist">'
    print ''
    #---------------------------------------------------------------------------------------------------
    print '<table border="0" cellpadding="1" cellspacing="1" width="100%">'
    print '<tbody>'
    form = cgi.FieldStorage()
    if(form.has_key("pickled")):
      p = xmlrpcclient.printer()
      
      p.getFeedByNumber(form["pickled"].value)
    print "\t<INPUT TYPE = hidden NAME = \"pickled\" VALUE = \"" + urllib.quote(form["pickled"].value) +"\">\n"
    print "\t<INPUT TYPE = submit VALUE = \"Delete\">\n"
    print "</tbody></table>"
    #---------------------------------------------------------------------------------------------------
    print ''
    print '</div>'
    
    print '		'
    print '</td>'
    print '        <td align="right" valign="top" width="20%">'
    print	'<table bgcolor="#101010" border="0" cellpadding="0" cellspacing="5" width="90%">'
    print '<tbody><tr>'
    print ' <td width="90%">'
    print ' <div class="izquierda" align="right">'
    print ' 	<a href="news-main.py" class="botonizquierda">Main</a>'
    print '  </div>'
    print '</td>'
    print '</tr>'
    print ''
    print ''
    print ''
    print ''
    print '<tr>'
    print ' <td width="90%">'
    print '  <div class="izquierda" align="right">'
    print '  	<a href="feeds-main.py" class="botonizquierda">Feeds</a>'
    print '  </div>'
    print ' </td>'
    print '</tr>'
    print ''
    print ''
    print ''
    print '<tr>'
    print ' <td width="90%">'
    print '  <div class="izquierda" align="right">'
    print '  	<a href="search-main.py" class="botonizquierda">Search</a>'
    print '  </div>'
    print ' </td>'
    print '</tr>'
    print ''
    print ''
    print '          <tr>'
    print '            <td bgcolor="#ff0000" height="1" width="90%"></td>'
    print '          </tr>'
    print '        </tbody></table>'
    print '		</td>'
    print '      </tr>'
    print '    </tbody></table></td>'
    print '    <td>&nbsp;</td>'
    print '  </tr>'
    print '  <tr>'
    print '    <td width="5%"></td>'
    print '    <td><img src="shellcodes_archivos/top_bg.png" height="3" width="193"></td>'
    print '    <td width="209"><img src="shellcodes_archivos/top_bg.png" height="3" width="209"></td>'
    print '    <td width="800"></td>'
    print '    <td width="5%"></td>'
    print '  </tr>'
    print '  </tbody></table>'
    #--------------------------------------------------------------------------------------------------------------
    #
    #---------------------------------------------------------------------------------------------------------------
    print ''
    print '<table border="0" cellpadding="0" cellspacing="0" width="100%">'
    print '      <tbody><tr>'
    print '        <td align="center" valign="top">&nbsp;</td>'
    print '        <td colspan="3" align="center" valign="top">&nbsp;</td>'
    print '        <td align="center" valign="top">&nbsp;</td>'
    print '      </tr>'
    print '      <tr>'
    print '          <td align="center" valign="top" width="5%"></td>'
    print '        <td align="center" valign="top"><img src="shellcodes_archivos/top_bg.png" height="3" width="193"></td>'
    print '        <td align="center" valign="top"></td>'
    print '        <td><img src="shellcodes_archivos/top_bg.png" height="3" width="209"></td>'
    print '        <td align="center" valign="top" width="5%"></td>'
    print '      </tr>'
    print ''
    print '  <tr>'
    print '    <td height="1"></td>'
    print '    <td colspan="3" bgcolor="#ff0000"></td>'
    print '    <td></td>'
    print '  </tr>'
    print '  <tr>'
    print '    <td>&nbsp;</td>'
    print '    <td>&nbsp;</td>'
    print '  </tr>'
    print '</tbody></table>'
    print '</div>'
    print '<br>'
    print ''
    print '</body></html>'
    
